import re

s = 'PythonC#JavaC#PHP'


def convert(value):
    matched = value.group()
    print(value)
    return '!!' + matched + '!!'


r = re.sub('C#', convert, s)

print(r)
